<include file="public:header" />
<div class="allpagetop">标签管理<strong>/</strong>列表</div>
<div class="admin_main_nr_dbox">
 	    <div class="pagetit">
	        <div class="ptit">标签</div>
				<div class="topnav">
			         
					  <a href="{:RU('tag/lists')}" <if condition="ACTION_NAME eq 'lists'">class="select"</if>>列表</a>
					   <a href="{:RU('tag/add')}" <if condition="ACTION_NAME eq 'add'">class="select"</if>>添加</a>
					   
					     <a href="{:RU('tag/cat')}" <if condition="ACTION_NAME eq 'cat'">class="select"</if>>分类</a>
				    <div class="clear"></div>
				</div>
	        <div class="clear"></div>
	    </div>
		
  
  
      <div class="seltpye_x">
        <div class="left">审核：</div>    
        <div class="right">
        <a href="{:P(array('audit'=>''))}" <if condition="$Think.get.audit eq ''">class="select"</if>>不限</a>
        <a href="{:P(array('audit'=>0))}" <if condition="$Think.get.audit eq '0'">class="select"</if>>未审核</a>
        <a href="{:P(array('audit'=>1))}" <if condition="$Think.get.audit eq '1'">class="select"</if>>已审核</a>
		 <a href="{:P(array('audit'=>'-1'))}" <if condition="$Think.get.audit eq '-1'">class="select"</if>>审核未通过</a>
   
        <div class="clear"></div>
        </div>
        <div class="clear"></div>
    </div>
  
  
  
    <form id="form1" name="form1" method="post" action="{:RU('tag/audit')}">
	
	  <div class="admin_list_th">
	    <div class="td1" style=" width:10%;"> 
		  
		  <label id="chkAll" class="left_txt_td"><input type="checkbox" name="chkAll"  id="chk" title="全选/反选" />标签</label>
		 
		</div>
		<div class="td4" style=" width:10%;">图形</div>
		<div class="td4" style=" width:10%;">审核</div>
		<div class="td4" style=" width:20%;<empty name="cat">width:30%;</empty>">描述</div>
		<notempty name="cat"><div class="td2" style=" width:10%;">分类</div></notempty>
		<div class="td2" style=" width:10%;">添加时间</div>
		<div class="td3" style=" width:10%;">排序</div>
		<div class="td2 admin_list_center" style=" width:10%;">问题/文章</div>
		
		<div class="td5" style=" width:10%;">
		<div class="admin_list_right">操作&nbsp;&nbsp;&nbsp;&nbsp;</div>
		</div>
	  <div class="clear"></div>
	  </div>
	  
	  
	    <volist name="tag.list" id="list">
					   <div class="admin_list_tr link_bk">
						<div class="td1" style=" width:10%;">
							  <div class="left_txt_td striking">
						 
									<input name="id[]" type="checkbox" id="id" value="{$list.id}"  />
									{$list.tag}
							  </div>
						</div>
						<div class="td4" style=" width:10%;">
						 <img src="{$list.img}" border="0" align="absmiddle" style="width:22px; height:22px; border-radius:4px;">
						</div>
						<div class="td4" style=" width:10%;">
						 {$list.audit_str}
						</div>
						<div class="td4 striking" style=" width:20%;<empty name="cat">width:30%;</empty>">
						 {$list.describe|default="没有添加任何描述哦！"}
						</div>
						<notempty name="cat">
						<div class="td2 " style=" width:10%;">
						{$list.cat_str|default="未分类"}
						</div>
						</notempty>
						 <div class="td2 " style=" width:10%;">
						 {$list.addtime|date="Y-m-d H:i",###}
						</div>
						<div class="td2 " style=" width:10%;">
						<input name="sort_id[]" type="hidden" value="{$list.id}" />
						<input name="sort[]" type="text"  class="input_text_default small" maxlength="100" value="{$list.sort}" style="width:50px;"/>
						</div>
						<div class="td2 admin_list_center" style=" width:10%;">
						 {$list.count_question}/{$list.count_article}
						</div>
						
						<div class="td5 edit" style=" width:10%;">
									  <div class="admin_list_right link_blue">
									  <a href="{:RU('tag/edit',array('id'=>$list['id']))}">修改</a>
											<a class="gray" href="{:RU('tag/delete',array('id'=>$list['id']))}" onclick="return confirm('你确定要删除吗？')">删除</a>
									  </div>
						</div>
					  <div class="clear"></div>
					  </div>
	   </volist>
	   
	  
	    <div id="J_audit_from"></div>
		<div id="J_cat_from"></div>

  </form>

  
  
    <empty name="list">
    <div class="admin_list_no_info">没有任何信息！</div>
    </empty>
	
	
	
	<div class="admin_list_foot">
			  <div class="btnbox">
			   <input type="button"  class="admin_submit"   value="审核" id="J_btn_audit"/>
			    <input type="button"  class="admin_submit"   value="删除"/ id="J_btn_del">
			 	 <input type="button"  class="admin_submit"   value="保存" id="J_save_sort_btn"/>
				<input type="button"  class="admin_submit"   value="更新统计" id="J_update_count_btn"/>
				<input type="button" class="admin_submit"   value="添加"  onclick="window.location='{:RU('tag/add')}'"/>
				
				<notempty name="cat">
				<input type="button"  class="admin_submit"   value="分类" id="J_cat_btn"/>
				</notempty>
			 
			  </div>
			  
			    <div class="footso">
			  			<form action="{:RU('tag/lists')}" method="get">
						<div class="sobox">
							<input name="key" type="text"  class="sinput" maxlength="10" value="{$Think.get.key}"/>
							<input name="key_type" id="J_key_type_id" type="hidden" value="{$Think.get.key_type|default="1"}" />
							<input name="key_type_cn" id="J_key_type_cn" type="hidden" value="{$Think.get.key_type_cn|default="标签"}" />
							<input name="" type="submit" value=""  class="sobtn"/>
							<div class="sotype" id="J_key_click">{$Think.get.key_type_cn|default="标签"}</div>
							
							
							
							
							
							<div class="mlist" id="J_mlist">
							<ul>
							<li id="1" title="标签">标签</li>
							<li id="2" title="描述">描述</li>
							</ul>
							</div>
						</div>
						</form>
			  </div>
			  
			  
			  
	          
	</div>
	
   <div class="uupage">{$tag.page}</div>
</div>
<include file="public:footer" />

<div id="J_audit_select" style="display:none">
		<div class="showdialog">
		<div class="dtit">将所选用户审核状态设置为：</div>
		  <div class="dtxt">
		 
						<div class="imgradio">
												<input name="audit" type="hidden" value="1" />
												<div class="radio select" data="1">审核通过</div>
												<div class="clear"></div>
												<div class="radio " data="-1">审核未通过</div>
												<div class="clear"></div>
						</div>
		  </div>
		
	       <div class="dtxt">
		   <input type="button"  class="admin_submit"   value="确定选择" id="J_save_audit_btn"/>
		   </div>
	 
	  </div>
</div>


<div id="J_cat_select" style="display:none">

  <div class="showdialog">
		<div class="dtit">将所选标签分类设置为</div>
		
			  <volist name="cat" id="catlist">
			<div class="dlistx" id="{$catlist.id}">{$catlist.title}</div>
			 </volist>
			<div class="clear"></div>
		
		
				<div class="auditbtns">
				   <input name="cat" type="hidden" value="" />
				   <input type="button"  class="admin_submit"   value="确定选择" id="J_save_cat_btn"/>
				 </div>
	  </div>

</div>



<script type="text/javascript">
    $(document).ready(function()
    {	
		//批量保存
		 $("#J_save_sort_btn").click(function(){
			 $("form[name=form1]").attr("action","{:RU('tag/allSave')}").submit();
        });
        //点击批量取删除   
        $("#J_btn_del").click(function(){
			
            if (confirm('你确定要删除吗？'))
            {
				$("form[name=form1]").attr("action","{:RU('tag/delete')}").submit();
            }
        });
		//批量审核弹窗
		$("#J_btn_audit").dialog({
		  DialogAddObj:"#J_audit_from",
		  DialogTitle:"请选择审核状态",
		  DialogContent:"#J_audit_select",
		  DialogContentType:"id"
		});
		//确定审核
		$('#J_save_audit_btn').live('click',function() {
			$("form[name=form1]").attr("action","{:RU('tag/audit')}").submit();
		});
		//更新标签统计
		$('#J_update_count_btn').live('click',function() {
			$("form[name=form1]").attr("action","{:RU('tag/counts')}").submit();
		});		
		//批量设置分类
		$("#J_cat_btn").dialog({
		  DialogAddObj:"#J_cat_from",
		  DialogTitle:"请选择转移分类",
		  DialogContent:"#J_cat_select",
		  DialogContentType:"id"
		});
		//确定转移分类
		$('#J_save_cat_btn').live('click',function() {
			$("form[name=form1]").attr("action","{:RU('tag/transfer')}").submit();
		});
		
		$('#J_cat_from .dlistx').live('click',function() {
		  $('#J_cat_from .dlistx').removeClass('select');
		  $(this).addClass('select');
		  $("input[name=cat]").val($(this).attr('id'));
		});
		
    });
</script>
</body>
</html>